// components/my-subject/my-subject.js
const App = getApp();
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    title: {
      type: String,
      value: ""
    },
    titleStyle: {
      type: String,
      value: "color:#000"
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    navH: 0,
    page_num: null
  },

  /**
   * 组件的方法列表
   */
  methods: {
    revert() {
      let pageNum = --getCurrentPages().length;
      if (!pageNum) {
        wx.navigateTo({
          url: '/pages/user_end/index/index'
        })
        return
      }
      this.setData({
        page_num: pageNum
      })
      wx.navigateBack({
        delta: pageNum
      });
    }
  },

  // 
  lifetimes: {
    attached: function () {
      let pageNum = --getCurrentPages().length;
      this.setData({
        navH: App.globalData.navHeight,
        page_num: pageNum
      })
    }
  }
})